package com.bj58.fintech.insurance.nacosconsumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author wangqiang
 * @date 2025/8/22
 * @description
 */
@RestController
public class ConsumerController {

    @Autowired
    private RestTemplate restTemplate;

    @Value("${service-user.nacos-user-service}")
    private String providerUrl;

    @GetMapping("/nacosConsumer")
    public String nacosConsumer(){
        return restTemplate.getForObject(providerUrl + "/getServerPort", String.class);
    }
}